package com.example.passwordmanager;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.example.passwordmanager.databinding.ActivityPsdBinding;

public class PsdActivity extends BaseActivity {
    ActivityPsdBinding activityPsdBinding;
    private boolean isAdd = true;
    private PsdFragment psdFragment;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        activityPsdBinding = ActivityPsdBinding.inflate(getLayoutInflater());
        setContentView(activityPsdBinding.getRoot());
        if (getIntent() != null) {
            isAdd = getIntent().getBooleanExtra("isAdd", true);
        }
        initView();


    }

    private void initView() {
        psdFragment= (PsdFragment) getSupportFragmentManager().findFragmentById(R.id.frame_psd);
        if (psdFragment==null){
            psdFragment=new PsdFragment();
            getSupportFragmentManager().beginTransaction().add(R.id.frame_psd, psdFragment).commit();
        }

    }

    public boolean isAdd() {
        return isAdd;
    }
}